package skladiscenje;

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import sun.jdbc.odbc.JdbcOdbcDriver;

public class Conn {
	
	private Connection c;
	
	public Conn() {
		try {
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			setC(DriverManager.getConnection("jdbc:odbc:skladiscenjeBaza"));
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
		
	public void zapri() {
		try {
			c.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	public void setC(Connection c) {
		this.c = c;
	}

	public Connection getC() {
		return c;
	}

}
